function ready_for_reading(){
	var top_pos = $('#header').height();
	bodyheight = $('body').height();
	wraper_content_height = bodyheight - top_pos -$('#footer').height();
	//alert(wraper_content_height);
	var content_story_height = $('#content_story').height();
	number_of_pages = Math.ceil(content_story_height/wraper_content_height);
	//alert(number_of_pages);
	$('#content_wraper').css({'height':wraper_content_height,'top':top_pos});
	$('#pagenumber').html(current_page+'/'+number_of_pages);
	//
}
$('#plus').click(function(){
	current_font_size = current_font_size+20;
	var fsize = current_font_size +'%'
	$('#content_story').css('font-size',fsize);
	ready_for_reading();
});
$('#unplus').click(function(){
	current_font_size = current_font_size-20;
	var fsize = current_font_size +'%'
	$('#content_story').css('font-size',fsize);
	ready_for_reading();
});
$('#btn_story_home').click(function(){
	window.history.back();
});
var currentpage=0;
var numberofpages = 0;
$('#btn_forward_footer').click(function(){
	nextPage();
});
$('#btn_back_footer').click(function(){
	prevPage();
});
function nextPage(){
	if (current_page<number_of_pages){
		current_pos = current_pos - wraper_content_height;
		//alert(current_pos);
		//$('#content_story').css('top':current_pos);
		$("#content_story").css('top',current_pos);
		current_page++;
		$('#pagenumber').html(current_page+'/'+number_of_pages);
		//alert(current_page+'/'+number_of_pages+'pages');
	}
}
function prevPage(){
	if (current_page>1){
		current_pos = current_pos + wraper_content_height;
		$("#content_story").css('top',current_pos);
		current_page--;
		//alert(current_page+'/'+number_of_pages+'pages');
		$('#pagenumber').html(current_page+'/'+number_of_pages);
	}
}
